<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.16.0/math.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        ul {
            list-style: none;
            overflow: hidden;
        }

        li {
            float: left;
            width: 100px;
            height: 50px;
            background: skyblue;
            text-align: center;
            color: green;
            line-height: 50px;
        }
        .box-cen {
        }
        .box-list {
            display: none;
            width: 700px;
            height: 251px;
            background: darkgoldenrod;
        }

        .active {
            background: greenyellow;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul class="uls">
            <li class="active">0</li>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
            <li>6</li>
        </ul>
        <div class="box-cen">
            <div class="box-list" style="display: block" >
0
            </div>
            <div class="box-list"> 
1
            </div>
            <div class="box-list" >
2
            </div>
            <div class="box-list"> 
3
            </div>
            <div class="box-list" >
4
            </div>
            <div class="box-list"> 
5
            </div>
            <div class="box-list" >
6
            </div>
            
            
        </div>
    </div>
    
    <script>
        var uls = document.getElementsByClassName("uls")[0]
        var lis = uls.getElementsByTagName("li")
        var boxList = document.getElementsByClassName("box-list")
        
        for (var i = 0; i < lis.length; i++) {
            (function (i) {               
                lis[i].onclick = function () {
                    for (var k = 0;k<lis.length;k++) {
                    boxList[k].style.display = "none"; 
                    lis[k].className = "";
                }
                    boxList[i].style.display = "block"; 
                    lis[i].className = "active";                  
                }
            }(i))
        }

        






    </script>
</body>

</html>